<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('短信提醒列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>提醒日期：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="product:checkMessage:remove">
                <i class="fa fa-remove"></i> 批量删除
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('product:checkMessage:edit')}]];
    var removeFlag = [[${@permission.hasPermi('product:checkMessage:remove')}]];
    var detailFlag = [[${@permission.hasPermi('product:checkMessage:detail')}]];
    var prefix = ctx + "product/checkMessage";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            detailUrl: prefix + "/detail/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "短信提醒",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '',
                    visible: false,
                    ignore: true
                },
                {
                    field: 'createDate',
                    title: '提醒日期',
                    sortable: true
                },
                {
                    field: 'productName',
                    title: '产品名称',
                    sortable: true
                },
                {
                    field: 'fileName',
                    title: '文件名',
                    sortable: true
                },
                {
                    field: 'departName',
                    title: '所属单位',
                    sortable: true
                },
                {
                    field: 'tipTypes',
                    title: '当前提醒阶段',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (0 === value){
                            return '异常提醒';
                        }else if (1 === value){
                            return '晚传提醒';
                        }else if (2 === value){
                            return '补传提醒';
                        }
                        else if (3 === value){
                            return '订阅到期提醒';
                        }
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
